﻿<UserControl
    x:Class="WinRTXamlToolkit.Sample.Views.LayoutTransformControlTestView"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:WinRTXamlToolkit.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:charting="using:WinRTXamlToolkit.Controls.DataVisualization.Charting">
    <UserControl.Resources>
        <!-- Note the below storyboard doesn't work. Possibly can't find an element called rotateTransform -->
        <!--<Storyboard
            x:Name="RotationStoryboard"
            RepeatBehavior="Forever"
            Duration="0:0:2">
            <DoubleAnimation
                Storyboard.TargetName="rotateTransform"
                Storyboard.TargetProperty="Angle"
                From="0"
                To="359.999"
                Duration="0:0:2" />
        </Storyboard>-->
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition
                Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid.Resources>
            <Style
                x:Key="TestRectStyle"
                TargetType="Rectangle">
                <Setter
                    Property="Width"
                    Value="115" />
                <Setter
                    Property="Height"
                    Value="115" />
                <Setter
                    Property="Fill"
                    Value="Red" />
                <Setter
                    Property="Margin"
                    Value="10" />
            </Style>
        </Grid.Resources>
        <TextBlock
            Style="{StaticResource PageSubheaderTextStyle}"
            Text="Note the limited performance of animations around LayoutTransformControl" />
        <controls:WrapPanel
            VerticalAlignment="Stretch"
            HorizontalAlignment="Center"
            Grid.Row="1"
            Width="500">
            <Rectangle
                Style="{StaticResource TestRectStyle}" />
            <Rectangle
                Style="{StaticResource TestRectStyle}" />
            <Rectangle
                Style="{StaticResource TestRectStyle}" />
            <Rectangle
                Style="{StaticResource TestRectStyle}" />
            <Border
                BorderThickness="3"
                CornerRadius="3"
                BorderBrush="Yellow"
                VerticalAlignment="Center"
                HorizontalAlignment="Center">
                <controls:LayoutTransformControl
                    x:Name="transformControl">
                    <controls:LayoutTransformControl.Transform>
                        <RotateTransform
                            x:Name="rotateTransform" />
                    </controls:LayoutTransformControl.Transform>
                    <TextBlock
                        Style="{StaticResource SubheaderTextStyle}"
                        Text="Hello LayoutTransformControl" />
                </controls:LayoutTransformControl>
            </Border>
            <Rectangle
                Style="{StaticResource TestRectStyle}" />
            <Rectangle
                Style="{StaticResource TestRectStyle}" />
            <Rectangle
                Style="{StaticResource TestRectStyle}" />
            <Rectangle
                Style="{StaticResource TestRectStyle}" />
        </controls:WrapPanel>
    </Grid>
</UserControl>
